package ve.ejb.entity;

import java.io.Serializable;
import java.util.Collection;
import java.util.Date;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

/**
 *
 * @author memozac
 */
@Entity
public class GrouperType implements Serializable {
    private static final long serialVersionUID = 1L;
    
    @Id @GeneratedValue(strategy = GenerationType.AUTO) private Long idGrouperType;

    @OneToMany private Collection<Grouper> groupers;

    @Column(columnDefinition="text") private String name;

    @Column(columnDefinition="text") private String description;

    @Temporal(value = TemporalType.TIMESTAMP) private Date registerDate;

    public Date getRegisterDate() {
        return registerDate;
    }

    public void setRegisterDate(Date registerDate) {
        this.registerDate = registerDate;
    }
    
    public String getDescription() {
        return description;
    }

    public void setDescription(String description) {
        this.description = description;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public Collection<Grouper> getGroupers() {
        return groupers;
    }

    public void setGroupers(Collection<Grouper> groupers) {
        this.groupers = groupers;
    }

    public Long getIdGrouperType() {
        return idGrouperType;
    }

    public void setIdGrouperType(Long idGrouperType) {
        this.idGrouperType = idGrouperType;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (idGrouperType != null ? idGrouperType.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        if (!(object instanceof GrouperType)) {
            return false;
        }
        GrouperType other = (GrouperType) object;
        if ((this.idGrouperType == null && other.idGrouperType != null) || (this.idGrouperType != null && !this.idGrouperType.equals(other.idGrouperType))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "ve.ejb.entity.GrouperType[id=" + idGrouperType + "]";
    }

}//ends of class
